package com.cars.elasticsearch.domain.DO;

import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * @author: caoqianfan
 * @date: 2023/10/12 15:46
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Course implements Serializable {

    @Serial
    private static final long serialVersionUID = 7572079589105750128L;

    @TableId(type = IdType.INPUT)
    Long id;

    String name;

    String type;

    Integer status;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT) //创建时自动填充
    private Date createTime;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)//创建与修改时自动填充
    private Date updateTime;

}